package org.hardcode.rpc.test.consumer.codec.init;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import org.hardcode.rpc.codec.RpcDecoder;
import org.hardcode.rpc.codec.RpcEncoder;
import org.hardcode.rpc.test.consumer.codec.handler.RpcTestConsumerHandler;

public class RpcTestConsumerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {

        ChannelPipeline pipeline = socketChannel.pipeline();

        pipeline.addLast(new RpcDecoder())
                .addLast(new RpcEncoder())
                .addLast(new RpcTestConsumerHandler());

    }
}
